package com.treasure.mall.zbqmallapi.vo.community;

import com.treasure.mall.biz.entity.community.CommunityArticlePO;
import com.treasure.mall.biz.vo.BaseVO;
import com.treasure.mall.zbq.common.ienum.community.CommunityEnums;
import com.treasure.mall.zbqmallapi.vo.user.UserBaseVO;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 *
 * <p>
 * +---------------------------------------------------------
 * * @package: com.treasure.mall.zbqmallapi.vo.community
 * * @author: guomw (guomwchen@foxmail.com)
 * * @date: 2020/7/28 10:39 上午
 * * @since: V1.0.0
 * +---------------------------------------------------------
 * 注意：本内容仅限于内部传阅，禁止外泄以及用于其他的商业目的
 * 
 */
@Data
@NoArgsConstructor
public class CommunityArticleVO implements BaseVO {
    private static final long serialVersionUID = -1236356365555375841L;
    /**
     * 文章ID
     */
    private Long id;
    /**
     * 文章标题
     */
    private String title;

    /**
     * 作者信息
     */
    private UserBaseVO author;
    /***
     * 封面主图
     */
    private String mainPic;
    /**
     * 访问量
     */
    private Long visitCount;
    /**
     * 图文
     */
    private CommunityEnums.ContentType contentType = CommunityEnums.ContentType.IMAGE_TEXT;

    public CommunityArticleVO(CommunityArticlePO po) {
        this.id = po.getId();
        this.title = po.getTitle();
        this.author = new UserBaseVO(po.getAuthor());
        this.mainPic = po.getMainPic();
        this.visitCount = po.getVisitCount();
        this.contentType = po.getContentType();
    }
}
